package com.pic.mgt.syushin.executer;

import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Map;

import com.pic.mgt.dao.syushin.SyushinTargetMessageDao;
import com.pic.mgt.executer.IGXTypeExecutionException;
import com.pic.mgt.syushin.unit.RealTargetOkSyushinMessageUnit;
import com.pic.mgt.syushin.unit.SyushinMessage;

public final class RealSyushinMessageUnitExecuter extends
		SyushinMessageUnitExecuter {

	@Override
	protected void executeIGXType() throws IGXTypeExecutionException {
		
	}
	
	@Override
	protected Map<String, Object> getInsertTargetMessageBasicValuesMap(SyushinMessage syushinMessage) {
		RealTargetOkSyushinMessageUnit realTargetOkSyushinMessageUnit =
									(RealTargetOkSyushinMessageUnit)syushinMessage;
		
		Map<String ,Object> insertValuesMap = new HashMap<String, Object>();

		insertValuesMap.put(SyushinTargetMessageDao._confirmationFile, realTargetOkSyushinMessageUnit.getConfirmationFilename());
		insertValuesMap.put(SyushinTargetMessageDao._transactionFile, realTargetOkSyushinMessageUnit.getTransactionFilename());
		insertValuesMap.put(SyushinTargetMessageDao._transactionTime, new Timestamp(realTargetOkSyushinMessageUnit.getTransactionTime().getTime()));
		insertValuesMap.put(SyushinTargetMessageDao._unitName, realTargetOkSyushinMessageUnit.getUnitName());
		insertValuesMap.put(SyushinTargetMessageDao._terminalId, realTargetOkSyushinMessageUnit.getTerminalId());
		// (送多方新增)
		insertValuesMap.put(SyushinTargetMessageDao._apName, realTargetOkSyushinMessageUnit.getApName());

		return insertValuesMap;
	}
}
